package com.atguigu.gmall.activity.redis;

import org.springframework.stereotype.Component;

/**
 * 接收到了Redis的消息之后处理类
 */
@Component
public class MessageReceive {

    //处理消息的方法
    public void receiveMessage(String message){
        System.out.println("收到状态位的消息：" + message);
        //message  "skuId:1"
        message =  message.replaceAll("\"","");
        String[] m = message.split(":");
        //本地内存中 就是Map
        CacheHelper.put(m[0],m[1]);
        System.out.println("key:" + m[0] + "===value:" + CacheHelper.get(m[0]));
    }
}
